<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      console.log(void 0);

      var obj = { x: 1 };
      Number(obj); // NaN
      console.log(Number(obj));
      // 等同于
      if (typeof obj.valueOf() === "object") {
        Number(obj.toString());
      } else {
        Number(obj.valueOf());
      }

      console.log("--------------------------------------------------");
      function idle(x) {
        try {
          console.log(x);
          return "result";
        } finally {
          console.log("FINALLY");
        }
      }

      idle("hello");
      console.dir(document.body);
      console.dirxml(document.body);

      for (var i = 0; i < 5; i++) {
        console.log(i);
        if (i === 2) debugger;
      }
    </script>
  </body>
</html>
